924cafd81ec0ebb8e717257ea402b99d70119090,WordPressUtils/src/main/java/org/wordpress/android/util/UrlUtils.java,UrlUtils,addUrlSchemeIfNeeded,#String#boolean#,92
Before Change
// switch between http or https
url = removeLeadingDoubleSlash(url, (isHTTPS ? "https" : "http") + "://");
if (!URLUtil.isValidUrl(url)) {
if (!(url.toLowerCase().startsWith("http://")) && !(url.toLowerCase().startsWith("https://"))) {
url = (isHTTPS ? "https" : "http") + "://" + url;
}
}
return url;
}
/**
After Change
url = removeLeadingDoubleSlash(url, (isHttps ? "https" : "http") + "://");
// If the URL is a valid http or https URL, we're good to go
if (URLUtil.isHttpUrl(url) || URLUtil.isHttpsUrl(url)) {
return url;
}
// Else, remove the old scheme and add prefix it by https:// or http://
return (isHttps ? "https" : "http") + "://" + removeScheme(url);
}
/**